 define(['zepto', 'com.infinitus.common/fd-slider/js/fd-slider.min'], function($, s) {

 	var Slider = function(config) {
 		console.info(fdSlider);
 		this.config = {};
 		this.config = $.extend(this.config, config);
 		this.targetObj = $("#" + config.id);
 		this.render();
 	};

 	Slider.prototype.render = function() {

 		//获取当前input的参数配置
 		var id = this.config.id;
 		var spanid = id + "_span";
 		var slider = $(this.targetObj);
 		var name = slider.attr("name");
 		var min = slider.attr("min");
 		var max = slider.attr("max");
 		var step = slider.attr("step");
 		var value = slider.attr("value");
 		var style = slider.attr('style');
 		var tabindex = slider.attr("tabindex");
 		var classes = slider.attr("class");

 		//构建div 插入input
 		var sliderDiv = $("<div></div>");
 		//var sliderSpan = $("<span></span>").attr('id', spanid).addClass("slider_span");
 		//if (value) sliderSpan.text(value);

 		var sliderInput = $("<input/>").attr('type', 'text').attr('id', id);
 		if (name) sliderInput.attr('name', name);
 		if (min) sliderInput.attr('min', min);
 		if (max) sliderInput.attr('max', max);
 		if (step) sliderInput.attr('step', step);
 		if (value) sliderInput.attr('value', value);
 		if (typeof(style) == 'string') sliderInput.attr('style', style);
 		if (tabindex) sliderInput.attr('tabindex', tabindex);
 		if (classes) sliderInput.addClass(classes);

 		var myconfig = this.config;


 		//sliderDiv.append(sliderSpan);
 		sliderDiv.append(sliderInput);

 		sliderDiv.insertBefore(slider);
 		slider.remove();

 		fdSlider.createSlider({
 			// Associate the form element
 			inp: document.getElementById(id),
 			// Declare a step (quoting the value means the precision will be
 			// calculated as 2 decimal points e.g. the "50" part of "0.50") which is
 			// a short-cut way of setting the precision without actually using the
 			// "precision" parameter
 			step: step,
 			// Declare a maxStep (for keyboard users)
 			maxStep: step,
 			// Min & Max values

 			min: min,
 			hideInput: false,
 			max: max,
 			//forceValue: true
 			forceValue: true,
 			// Use the "timed increments to click point" animation
 			animation: "timed"
 		});


 		var p = sliderInput.parent();
 		var fd = p.find('.fd-slider');
 		console.info(p);
 		sliderInput.insertBefore(fd);
 		p.css({
 			'float': 'left',
 			'width': '100%',
 			'max-height': '30px',
 			'padding-top': '10px'
 		});
 		sliderInput.css({
 			'float': 'left',
 			'width': '20%'
 		});
 		fd.css({
 			'float': 'left',
 			'width': '72%',
 			'margin-top': '8px'
 		});

 		sliderInput.attr('type', 'number');

 		fdSlider.updateSlider(id);
 		// fdSlider.addEvent(document.getElementById(id), "change", function(e) {
 		// 	sliderSpan.text($('#' + id).val());
 		// 	console.info('=============' + sliderSpan);
 		// });


 		// sliderInput.change(function() {
 		// 	var value = $(this).val();
 		// 	sliderSpan.text(value);
 		// 	if (myconfig.change) myconfig.change(value);
 		// });
 	};


 	return Slider;
 });

 // require(['cube/cube-list']);